package org.lnstark.admin.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.JSONPObject;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * by Lnstark
 * 2021/6/17
 */
@RestController
public class LoginController {

    @PostMapping("api/user/public/login")
    public JSONObject login() {
        JSONObject json = new JSONObject();
        json.put("code", 1);
        JSONObject data = new JSONObject();
        data.put("token", "sdfsdf");
        data.put("user", "ssdf");
        json.put("data", data);
        json.put("msg", "login success");
        return json;
    }

    @PostMapping("api/user/public/logout")
    public JSONObject logout() {
        JSONObject json = new JSONObject();
        json.put("code", 1);
        json.put("msg", "logout success");
        return json;
    }

    @PostMapping("api/wms/Supplier/index")
    public JSONObject sup() {
        JSONObject json = new JSONObject();
        json.put("code", 1);
        JSONArray data = new JSONArray();
        JSONObject o = new JSONObject();
        o.put("name", "供应商1");
        o.put("contact", "张三");
        o.put("phone", "14813215");
        o.put("status", 0);
        data.add(o);
        json.put("data", data);
        return json;
    }

}
